<template>
  <div>
    <div class="pay_box">
      <div class="cost-button" :class="{ cost_active: flog == 1 }" @click="getActive(1)">收费日报</div>
      <div class="cost-button" :class="{ cost_active: flog == 5 }" @click="getActive(5)">收费月报</div>
      <div class="cost-button" :class="{ cost_active: flog == 3 }" @click="getActive(3)">收费明细</div>
      <div class="cost-button" :class="{ cost_active: flog == 4 }" @click="getActive(4)">挂账明细</div>
      <div class="cost-button" :class="{ cost_active: flog == 2 }" @click="getActive(2)">储值卡余额</div>
      <div class="cost-button" :class="{ cost_active: flog == 6 }" @click="getActive(6)">收费分类</div>
      <div class="cost-button" :class="{ cost_active: flog == 7 }" @click="getActive(7)">退费明细</div>
      <div class="cost-button" :class="{ cost_active: flog == 8 }" @click="getActive(8)">处方收入</div>
    </div>
    <comm :is="activeName"></comm>
  </div>
</template>
<script>
export default {
  data() {
    return {
      activeName: "day",
      flog: 1,
    };
  },
  mounted() {},
  methods: {
    getActive(type) {
      let th = this;
      th.flog = type;
      switch (type) {
        case 1:
          th.activeName = "day";
          break;
        case 2:
          th.activeName = "money";
          break;
        case 3:
          th.activeName = "charge";
          break;
        case 4:
          th.activeName = "account";
          break;
        case 5:
          th.activeName = "month";
          break;
        case 6:
          th.activeName = "type";
          break;
        case 7:
          th.activeName = "refundDetail";
          break;
        case 8:
          th.activeName = "prescription";
          break;
      }
    },
  },
  components: {
    day: () => import("../_childComm/day"),
    month: () => import("../_childComm/month"),
    money: () => import("../_childComm/money"),
    charge: () => import("../_childComm/charge"),
    account: () => import("../_childComm/account"),
    type: () => import("../_childComm/type"),
    refundDetail: () => import("../_childComm/refundDetail"),
    prescription: () => import("../_childComm/prescription"),
  },
};
</script>
<style lang="scss" scoped>
.pay_box {
  margin: 10px 0px;
  display: inline-block;
  width: 100%;
}
.pay_date {
  width: 10% !important;
  margin-right: 1%;
}
.cost-button {
  display: inline-block;
  width: 120px;
  margin-right: 15px;
  text-align: center;
  border: 1px solid #ddd;
  border-radius: 5px;
  cursor: pointer;
  height: 34px;
  line-height: 32px;
}
.cost_active {
  border-color: #1ab394;
  color: #1ab394;
}
</style>
